<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动</title>
    <style>
        .box1 {
            width: 200px;
            height: 200px;
            background-color: red;

            /* 浮动特点 */
            /* 
                1.脱离文档流
                2.顶对齐
                3.具有行内快元素的特点
            */
            float: left;
        }

        .box2 {
            width: 300px;
            height: 300px;
            background-color: green;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>

</html>